/**
 ******************************************************************************
 * @file    cx32l003_it.c
 * @author  MCU Software Team
 * @version V1.0.0
 * @date    21-Oct-2019
 * @brief   Interrupt Service Routines.
 ******************************************************************************
*/
/* USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "cx32l003_hal.h"
#include "cx32l003_it.h"

/* Private includes ----------------------------------------------------------*/
#include "ls_gpio.h"
#include "ls_syscfg.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private user code ---------------------------------------------------------*/

/* External variables --------------------------------------------------------*/

/******************************************************************************/
/*           Cortex-M0+ Processor Interruption and Exception Handlers          */
/******************************************************************************/
///**
// * @brief This function handles Non maskable interrupt.
// */
//void NMI_Handler(void)
//{
//    /* USER CODE BEGIN NonMaskableInt_IRQn 0 */

//    /* USER CODE END NonMaskableInt_IRQn 0 */
//}

/**
 * @brief This function handles Hard fault interrupt.
 */
void HardFault_Handler(void)
{
    /* USER CODE BEGIN HardFault_IRQn 0 */

    /* USER CODE END HardFault_IRQn 0 */
    while (1)
    {
        /* USER CODE BEGIN W1_HardFault_IRQn 0 */
        /* USER CODE END W1_HardFault_IRQn 0 */
    }
}

/******************************************************************************/
/* CX32L003 Peripheral Interrupt Handlers                                    */
/* Add here the Interrupt Handlers for the used peripherals.                  */
/* For the available peripheral interrupt handler names,                      */
/* please refer to the startup file (startup_xm32f1xx.s).                    */
/******************************************************************************/

/**
 * @brief This function handles GPIOA Interrupt line[3:1] interrupts.
 */
void GPIOA_IRQHandler(void)
{
    /* USER CODE BEGIN GPIOA_IRQn 0 */
    /* USER CODE END GPIOA_IRQn 0 */
}

/**
 * @brief This function handles GPIOB Interrupt line[5:4] interrupts.
 */
void GPIOB_IRQHandler(void)
{
    /* USER CODE BEGIN GPIOB_IRQn 0 */
    /* USER CODE END GPIOB_IRQn 0 */
}

/**
 * @brief This function handles GPIOC Interrupt line[7:3] interrupts.
 */
void GPIOC_IRQHandler(void)
{
    /* USER CODE BEGIN GPIOC_IRQn 0 */
    /* USER CODE END GPIOC_IRQn 0 */
}

/**
 * @brief This function handles GPIOD Interrupt line[6:1] interrupts.
 */
void GPIOD_IRQHandler(void)
{
    /* USER CODE BEGIN GPIOD_IRQn 0 */
    // if (__HAL_GPIO_EXTI_GET_FLAG(LS_BUTTON0_GPIO_PORT, LS_BUTTON0_PIN) != RESET)
    //     HAL_GPIO_EXTI_IRQHandler(LS_BUTTON0_GPIO_PORT, LS_BUTTON0_PIN);

    // if (__HAL_GPIO_EXTI_GET_FLAG(LS_BUTTON1_GPIO_PORT, LS_BUTTON1_PIN) != RESET)
    //     HAL_GPIO_EXTI_IRQHandler(LS_BUTTON1_GPIO_PORT, LS_BUTTON1_PIN);

    // if (__HAL_GPIO_EXTI_GET_FLAG(LS_BUTTON2_GPIO_PORT, LS_BUTTON2_PIN) != RESET)
    //     HAL_GPIO_EXTI_IRQHandler(LS_BUTTON2_GPIO_PORT, LS_BUTTON2_PIN);

    /* USER CODE END GPIOD_IRQn 0 */
}

///**
// * @brief This function handles FLASH Interrupt .
// */
//void FLASH_IRQHandler(void)
//{
//    /* USER CODE BEGIN FLASH_IRQn 0 */

//    /* USER CODE END FLASH_IRQn 0 */
//}

///**
// * @brief This function handles LPUART Interrupt .
// */
//void LPUART_IRQHandler(void)
//{
//    /* USER CODE BEGIN LPUART_IRQn 0 */

//    /* USER CODE END LPUART_IRQn 0 */
//}

///**
// * @brief This function handles SPI Interrupt .
// */
//void SPI_IRQHandler(void)
//{
//    /* USER CODE BEGIN SPI_IRQn 0 */

//    /* USER CODE END SPI_IRQn 0 */
//}

///**
// * @brief This function handles I2C Interrupt .
// */
//void I2C_IRQHandler(void)
//{
//    /* USER CODE BEGIN I2C_IRQn 0 */

//    /* USER CODE END I2C_IRQn 0 */
//}

///**
// * @brief This function handles TIM10 Interrupt .
// */
//void TIM10_IRQHandler(void)
//{
//    /* USER CODE BEGIN TIM10_IRQn 0 */

//    /* USER CODE END TIM10_IRQn 0 */
//}

///**
//  * @brief This function handles TIM11 Interrupt .
//  */
//void TIM11_IRQHandler(void)
//{
//    /* USER CODE BEGIN TIM11_IRQn 0 */

//    /* USER CODE END TIM11_IRQn 0 */
//}

///**
// * @brief This function handles LPTIM Interrupt .
// */
//void LPTIM_IRQHandler(void)
//{
//    /* USER CODE BEGIN LPTIM_IRQn 0 */

//    /* USER CODE END LPTIM_IRQn 0 */
//}

///**
// * @brief This function handles TIM1 Interrupt .
// */
//void TIM1_IRQHandler(void)
//{
//}

///**
// * @brief This function handles TIM2 Interrupt .
// */
//void TIM2_IRQHandler(void)
//{
//}

///**
// * @brief This function handles PCA Interrupt .
// */
//void PCA_IRQHandler(void)
//{
//    /* USER CODE BEGIN PCA_IRQn 0 */

//    /* USER CODE END PCA_IRQn 0 */
//}

///**
// * @brief This function handles WWDG Interrupt .
// */
//void WWDG_IRQHandler(void)
//{
//    /* USER CODE BEGIN WWDG_IRQn 0 */

//    /* USER CODE END WWDG_IRQn 0 */
//}

///**
// * @brief This function handles IWDG Interrupt .
// */
//void IWDG_IRQHandler(void)
//{
//    /* USER CODE BEGIN IWDG_IRQn 0 */

//    /* USER CODE END IWDG_IRQn 0 */
//}
//#if LS_ADC0_EN
//extern ADC_HandleTypeDef adc0_handle_t;
//#endif
/**
 * @brief This function handles ADC Interrupt .
 */
//void ADC_IRQHandler(void)
//{
//    /* USER CODE BEGIN ADC_IRQn 0 */
//#if LS_ADC0_EN
//    HAL_ADC_IRQHandler(&adc0_handle_t);
//#endif
//    /* USER CODE END ADC_IRQn 0 */
//}

///**
// * @brief This function handles LVD Interrupt .
// */
//void LVD_IRQHandler(void)
//{
//    /* USER CODE BEGIN LVD_IRQn 0 */

//    /* USER CODE END LVD_IRQn 0 */
//}

///**
// * @brief This function handles VC Interrupt .
// */
//void VC_IRQHandler(void)
//{
//    /* USER CODE BEGIN VC_IRQn 0 */

//    /* USER CODE END VC_IRQn 0 */
//}

///**
// * @brief This function handles AWK Interrupt .
// */
//void AWK_IRQHandler(void)
//{
//    /* USER CODE BEGIN AWK_IRQn 0 */

//    /* USER CODE END AWK_IRQn 0 */
//}

///**
//  * @brief This function handles OWIRE Interrupt .
//  */
//void OWIRE_IRQHandler(void)
//{
//    /* USER CODE BEGIN OWIRE_IRQn 0 */

//    /* USER CODE END OWIRE_IRQn 0 */
//}

///**
// * @brief This function handles RTC Interrupt .
// */
//void RTC_IRQHandler(void)
//{
//    /* USER CODE BEGIN RTC_IRQn 0 */

//    /* USER CODE END RTC_IRQn 0 */
//}

///**
// * @brief This function handles CLKTRIM Interrupt .
// */
//void CLKTRIM_IRQHandler(void)
//{
//    /* USER CODE BEGIN CLKTRIM_IRQn 0 */

//    /* USER CODE END CLKTRIM_IRQn 0 */
//}
